.class public Lcom/xingbook/ui/ai;
.super Landroid/view/View;


# instance fields
.field public a:Ljava/lang/String;

.field public b:I

.field public c:F

.field public d:I

.field public e:Landroid/graphics/Typeface;

.field public f:I

.field public g:Landroid/graphics/Bitmap;

.field public h:Landroid/graphics/Paint;

.field private i:Landroid/graphics/RectF;

.field private j:I

.field private k:F

.field private l:F

.field private m:F


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 3

    const/4 v2, 0x1

    const/4 v1, 0x0

    invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/xingbook/ui/ai;->a:Ljava/lang/String;

    const/4 v0, -0x1

    iput v0, p0, Lcom/xingbook/ui/ai;->b:I

    const/high16 v0, 0x4180

    iput v0, p0, Lcom/xingbook/ui/ai;->c:F

    const/16 v0, 0x11

    iput v0, p0, Lcom/xingbook/ui/ai;->d:I

    sget-object v0, Landroid/graphics/Typeface;->DEFAULT:Landroid/graphics/Typeface;

    iput-object v0, p0, Lcom/xingbook/ui/ai;->e:Landroid/graphics/Typeface;

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/ui/ai;->f:I

    iput-object v1, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    iput-object v1, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    const v0, -0x777778

    iput v0, p0, Lcom/xingbook/ui/ai;->j:I

    const/high16 v0, 0x3f80

    iput v0, p0, Lcom/xingbook/ui/ai;->m:F

    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setFlags(I)V

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Align;->LEFT:Landroid/graphics/Paint$Align;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setTextAlign(Landroid/graphics/Paint$Align;)V

    new-instance v0, Landroid/graphics/RectF;

    invoke-direct {v0}, Landroid/graphics/RectF;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    return-void
.end method


# virtual methods
.method public a(IFF)V
    .locals 0

    iput p1, p0, Lcom/xingbook/ui/ai;->j:I

    iput p2, p0, Lcom/xingbook/ui/ai;->k:F

    iput p3, p0, Lcom/xingbook/ui/ai;->l:F

    return-void
.end method

.method public getTextWidth()F
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget v1, p0, Lcom/xingbook/ui/ai;->b:I

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget v1, p0, Lcom/xingbook/ui/ai;->c:F

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setTextSize(F)V

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget-object v1, p0, Lcom/xingbook/ui/ai;->e:Landroid/graphics/Typeface;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget-object v1, p0, Lcom/xingbook/ui/ai;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F

    move-result v0

    return v0
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 10

    const/4 v9, 0x5

    const/4 v8, 0x3

    const/high16 v2, -0x4080

    const/high16 v7, 0x4000

    iget-object v0, p0, Lcom/xingbook/ui/ai;->a:Ljava/lang/String;

    if-eqz v0, :cond_7

    const-string v0, ""

    iget-object v1, p0, Lcom/xingbook/ui/ai;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_7

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget v1, p0, Lcom/xingbook/ui/ai;->b:I

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget v1, p0, Lcom/xingbook/ui/ai;->c:F

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setTextSize(F)V

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget-object v1, p0, Lcom/xingbook/ui/ai;->e:Landroid/graphics/Typeface;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getFontMetrics()Landroid/graphics/Paint$FontMetrics;

    move-result-object v1

    iget-object v0, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget-object v3, p0, Lcom/xingbook/ui/ai;->a:Ljava/lang/String;

    invoke-virtual {v0, v3}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F

    move-result v3

    iget v0, p0, Lcom/xingbook/ui/ai;->d:I

    and-int/lit8 v0, v0, 0x3

    if-ne v0, v8, :cond_2

    iget-object v0, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    if-eqz v0, :cond_1

    iget v0, p0, Lcom/xingbook/ui/ai;->f:I

    mul-int/lit8 v0, v0, 0x2

    iget-object v4, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v4

    add-int/2addr v0, v4

    :goto_0
    int-to-float v0, v0

    :goto_1
    iget-object v4, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    iget v4, v4, Landroid/graphics/RectF;->bottom:F

    iget v5, v1, Landroid/graphics/Paint$FontMetrics;->descent:F

    sub-float/2addr v4, v5

    iget v1, v1, Landroid/graphics/Paint$FontMetrics;->ascent:F

    sub-float v1, v4, v1

    div-float/2addr v1, v7

    iget-object v4, p0, Lcom/xingbook/ui/ai;->a:Ljava/lang/String;

    iget-object v5, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    invoke-virtual {p1, v4, v0, v1, v5}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    add-float v1, v0, v3

    move v6, v1

    :goto_2
    iget-object v1, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    iget v1, v1, Landroid/graphics/RectF;->bottom:F

    iget-object v3, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v3

    int-to-float v3, v3

    sub-float/2addr v1, v3

    div-float/2addr v1, v7

    iget-object v3, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    iget v4, p0, Lcom/xingbook/ui/ai;->f:I

    sub-int/2addr v3, v4

    int-to-float v3, v3

    sub-float/2addr v2, v3

    iget-object v3, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    sget-object v4, Landroid/graphics/Typeface;->DEFAULT:Landroid/graphics/Typeface;

    invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    iget-object v3, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    const/4 v4, 0x0

    invoke-virtual {p1, v3, v2, v1, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    :cond_0
    iget-object v1, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget v2, p0, Lcom/xingbook/ui/ai;->m:F

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v1, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    iget v2, p0, Lcom/xingbook/ui/ai;->j:I

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setColor(I)V

    iget-object v1, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    sget-object v2, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    iget-object v1, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    sget-object v2, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    iget-object v1, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    iget v1, v1, Landroid/graphics/RectF;->bottom:F

    iget v2, p0, Lcom/xingbook/ui/ai;->m:F

    sub-float/2addr v1, v2

    div-float/2addr v1, v7

    float-to-int v7, v1

    iget v1, p0, Lcom/xingbook/ui/ai;->d:I

    and-int/lit8 v1, v1, 0x3

    if-ne v1, v8, :cond_5

    iget v0, p0, Lcom/xingbook/ui/ai;->f:I

    int-to-float v0, v0

    add-float v1, v6, v0

    int-to-float v2, v7

    iget-object v0, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    iget v0, v0, Landroid/graphics/RectF;->right:F

    iget v3, p0, Lcom/xingbook/ui/ai;->l:F

    sub-float v3, v0, v3

    int-to-float v4, v7

    iget-object v5, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    move-object v0, p1

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    :goto_3
    return-void

    :cond_1
    iget v0, p0, Lcom/xingbook/ui/ai;->f:I

    goto/16 :goto_0

    :cond_2
    iget v0, p0, Lcom/xingbook/ui/ai;->d:I

    and-int/lit8 v0, v0, 0x5

    if-ne v0, v9, :cond_3

    iget-object v0, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    iget v0, v0, Landroid/graphics/RectF;->right:F

    sub-float/2addr v0, v3

    iget v4, p0, Lcom/xingbook/ui/ai;->f:I

    int-to-float v4, v4

    sub-float/2addr v0, v4

    goto/16 :goto_1

    :cond_3
    iget-object v0, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    iget v0, v0, Landroid/graphics/RectF;->right:F

    sub-float v4, v0, v3

    iget-object v0, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    if-nez v0, :cond_4

    const/4 v0, 0x0

    :goto_4
    int-to-float v0, v0

    sub-float v0, v4, v0

    iget v4, p0, Lcom/xingbook/ui/ai;->f:I

    int-to-float v4, v4

    sub-float/2addr v0, v4

    div-float/2addr v0, v7

    goto/16 :goto_1

    :cond_4
    iget-object v0, p0, Lcom/xingbook/ui/ai;->g:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    goto :goto_4

    :cond_5
    iget v1, p0, Lcom/xingbook/ui/ai;->d:I

    and-int/lit8 v1, v1, 0x5

    if-ne v1, v9, :cond_6

    iget v1, p0, Lcom/xingbook/ui/ai;->k:F

    int-to-float v2, v7

    iget v3, p0, Lcom/xingbook/ui/ai;->f:I

    int-to-float v3, v3

    sub-float v3, v0, v3

    int-to-float v4, v7

    iget-object v5, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    move-object v0, p1

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    goto :goto_3

    :cond_6
    iget v1, p0, Lcom/xingbook/ui/ai;->k:F

    int-to-float v2, v7

    iget v3, p0, Lcom/xingbook/ui/ai;->f:I

    int-to-float v3, v3

    sub-float v3, v0, v3

    int-to-float v4, v7

    iget-object v5, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    move-object v0, p1

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    iget v0, p0, Lcom/xingbook/ui/ai;->f:I

    int-to-float v0, v0

    add-float v1, v6, v0

    int-to-float v2, v7

    iget-object v0, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    iget v0, v0, Landroid/graphics/RectF;->right:F

    iget v3, p0, Lcom/xingbook/ui/ai;->l:F

    sub-float v3, v0, v3

    int-to-float v4, v7

    iget-object v5, p0, Lcom/xingbook/ui/ai;->h:Landroid/graphics/Paint;

    move-object v0, p1

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    goto :goto_3

    :cond_7
    move v6, v2

    move v0, v2

    goto/16 :goto_2
.end method

.method protected onLayout(ZIIII)V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    sub-int v1, p4, p2

    int-to-float v1, v1

    iput v1, v0, Landroid/graphics/RectF;->right:F

    iget-object v0, p0, Lcom/xingbook/ui/ai;->i:Landroid/graphics/RectF;

    sub-int v1, p5, p3

    int-to-float v1, v1

    iput v1, v0, Landroid/graphics/RectF;->bottom:F

    invoke-super/range {p0 .. p5}, Landroid/view/View;->onLayout(ZIIII)V

    return-void
.end method
